﻿<Window x:Class="WpfWordsLearner.Views.AddWordsRangeView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mv="clr-namespace:WpfWordsLearner.ViewModels"
        Title="Add Words Range View" Height="300" Width="365">
	<Window.Resources>
		<mv:AddWordListViewModel x:Key="VM"/>
	</Window.Resources>
	<Grid DataContext="{StaticResource VM}">
		<Grid.RowDefinitions>
			<RowDefinition/>
			<RowDefinition Height="25"/>
		</Grid.RowDefinitions>
		<DataGrid x:Name="drgWordRange" AutoGenerateColumns="False" CanUserAddRows="True"
				  ItemsSource="{Binding Path=WordList}">
			<DataGrid.Columns>
				<DataGridTextColumn Width="130" Header="Word:" Binding="{Binding Path=EnglishWord}"/>
				<DataGridTextColumn Width="200" Header="Translate:" Binding="{Binding Path=Translate}"/>
			</DataGrid.Columns>
		</DataGrid>
		<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
			<Button x:Name="btnAdd" Content="Add" Width="50" 
					Command="{Binding Source={StaticResource VM}, Path=AddCommand}"/>
			<Button x:Name="btnCancel" Content="Cancel" Width="50" IsCancel="True"
					Command="{Binding Source={StaticResource VM}, Path=CancelCommand}"/>
		</StackPanel>
	</Grid>
</Window>
